<!DOCTYPE html>
<html lang="zh">
<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
<title>windows 使用docker-compose+DockerFile部署项目(内含laravel-echo-server) - BoBoBo客</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">



    <meta name="description" content="平时开发环境是windows下的集成环境，在一年前下载了Docker Desktop 想安装laradock 但是忘了什么原因了 失败了，最近闲来没事准备整一下本地的dockfile一键部署  本文的阅读和实践需要一些docker、lnmp、docker命令等基础。重申一下 这是windows环境下laravel项目的部署。  感谢laradock项目给我的很多地方的灵感，让我自己编写docke">
<meta name="keywords" content="laravel-echo-server,docker,supervisor">
<meta property="og:type" content="article">
<meta property="og:title" content="windows 使用docker-compose+DockerFile部署项目(内含laravel-echo-server)">
<meta property="og:url" content="http://enzolwb.gitee.io/2020/09/15/windows-使用docker-compose-DockFile部署项目-内含laravel-echo-server/index.html">
<meta property="og:site_name" content="BoBoBo客">
<meta property="og:description" content="平时开发环境是windows下的集成环境，在一年前下载了Docker Desktop 想安装laradock 但是忘了什么原因了 失败了，最近闲来没事准备整一下本地的dockfile一键部署  本文的阅读和实践需要一些docker、lnmp、docker命令等基础。重申一下 这是windows环境下laravel项目的部署。  感谢laradock项目给我的很多地方的灵感，让我自己编写docke">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2021-09-03T02:45:54.096Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="windows 使用docker-compose+DockerFile部署项目(内含laravel-echo-server)">
<meta name="twitter:description" content="平时开发环境是windows下的集成环境，在一年前下载了Docker Desktop 想安装laradock 但是忘了什么原因了 失败了，最近闲来没事准备整一下本地的dockfile一键部署  本文的阅读和实践需要一些docker、lnmp、docker命令等基础。重申一下 这是windows环境下laravel项目的部署。  感谢laradock项目给我的很多地方的灵感，让我自己编写docke">





<link rel="icon" href="/thumbnails/code.png">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/atom-one-dark.css">


    
    
    
    <style>body>.footer,body>.navbar,body>.section{opacity:0}</style>
    

    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">
    

    
    

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">


    
    
    
    

<link rel="stylesheet" href="/css/back-to-top.css">


    
    

    
    
    
    

    
    
<link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

    
    
    

    
    
    


<link rel="stylesheet" href="/css/style.css">
</head>
<body class="is-3-column">
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                LiWb Blog
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item" href="/archives">归档</a>
                
                <a class="navbar-item" href="/categories">分类</a>
                
                <a class="navbar-item" href="/tags">标签</a>
                
                <a class="navbar-item" href="/about">读我</a>
                
                <a class="navbar-item" href="/links">友链</a>
                
            </div>
            
            <div class="navbar-end">
            <a class="navbar-item" target="_blank" title="LeetCode" href="https://leetcode-cn.com/">YYDS</a>
                
                
                
                <a class="navbar-item search" title="搜索" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-6-widescreen has-order-2 column-main"><div class="card">
    
    <div class="card-image">
        <span class="image is-7by1">
            <img class="thumbnail" src="/thumbnails/lv1.png" alt="windows 使用docker-compose+DockerFile部署项目(内含laravel-echo-server)">
        </span>
    </div>
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2020-09-15T06:03:28.000Z">2020-09-15</time>
                
                <div class="level-item">
                <a class="has-link-grey -link" href="/categories/服务端/">服务端</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    15 分钟 读完 (大约 2298 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                windows 使用docker-compose+DockerFile部署项目(内含laravel-echo-server)
            
        </h1>
        <div class="content">
            <blockquote>
<p>平时开发环境是windows下的集成环境，在一年前下载了Docker Desktop 想安装laradock 但是忘了什么原因了 失败了，最近闲来没事准备整一下本地的dockfile一键部署</p>
</blockquote>
<p><strong>本文的阅读和实践需要一些docker、lnmp、docker命令等基础。</strong><br><strong>重申一下 这是windows环境下laravel项目的部署。</strong></p>
<blockquote>
<p>感谢laradock项目给我的很多地方的灵感，让我自己编写dockerfile时得心应手。大家在部署的时候也可以参考它的源代码</p>
</blockquote>
<h2 id="目录"><a href="#目录" class="headerlink" title="目录"></a>目录</h2><ol>
<li><a href="#d1">Docker Desktop 的安装 以及 配置</a></li>
<li><a href="#d2">docker-compose.yml + dockerfile 文件说明</a></li>
<li><a href="#d3">laravel-echo-server的部署指南</a></li>
<li><a href="#d4">supervisor 监控队列</a></li>
<li><a href="#d5">容器内的定时任务</a></li>
<li><a href="#d5">k8s 入门调试(下一篇文章吧)</a><a id="more"></a>
<h4 id="1-Docker-Desktop-的安装-以及配置"><a href="#1-Docker-Desktop-的安装-以及配置" class="headerlink" title="1.Docker Desktop 的安装 以及配置"></a><a href="#d1">1.Docker Desktop 的安装 以及配置</a></h4>就是官网下载安装，修改镜像源(Setting-Docker Engine-registry-mirrors,可以去DAOCloud找个源)。现在的desktop 更新的很智能了，不像之前还要手动添加允许file sharing，现在都随着挂载随着提示你允许，并且应该是自动安装好docker-compose,如果没有安装，就百度下安装方式吧。<h4 id="2-docker-compose-yml-dockerfile-文件说明"><a href="#2-docker-compose-yml-dockerfile-文件说明" class="headerlink" title="2.docker-compose.yml + dockerfile 文件说明"></a><a href="#d2">2.docker-compose.yml + dockerfile 文件说明</a></h4><strong>先看下大体的项目目录吧</strong><h1 id="project"><a href="#project" class="headerlink" title="project"></a>project</h1></li>
</ol>
<ul>
<li>app</li>
<li>config</li>
<li>docker</li>
<li><ul>
<li>app_local.dockerfile（workspace容器部署文件）</li>
</ul>
</li>
<li><ul>
<li>supervisor.conf（supervisord 配置文件）</li>
</ul>
</li>
<li><ul>
<li>crontabs（容器内的定时任务）</li>
</ul>
</li>
<li><ul>
<li>laravel-echo-server.dockerfile</li>
</ul>
</li>
<li><ul>
<li>package.json(单独安装laravel-echo-server 的)</li>
</ul>
</li>
<li><ul>
<li>php.ini</li>
</ul>
</li>
<li><ul>
<li>vhost.conf</li>
</ul>
</li>
<li><ul>
<li>web.dockerfile</li>
</ul>
</li>
<li>public</li>
<li>resources</li>
<li>….</li>
<li>.env</li>
<li>.laravel-echo-server.json</li>
<li>.docker-compose.yml</li>
<li>…..</li>
</ul>
<hr>
<ul>
<li><p>项目目录下创建docker-compose.yml和 docker/ *.dockfile,然后根据项目具体需求调整文件内容，下面我把用过的所有服务都列到下面举个例子。直接在代码里说明吧<br><strong>composer和node我没有选择使用镜像容器处理，因为可扩展性不是很好，平时更新项目时可能需要修改composer和npm，我也下载过镜像进行模拟 使用起来都不尽如人意，不如直接在php app的容器(workspace)中进行命令操作。</strong></p>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></td><td class="code"><pre><span class="line">version: '3.7'</span><br><span class="line">services:</span><br><span class="line">  app:</span><br><span class="line">    image: xxx_app #镜像名称</span><br><span class="line">    build: #指定该容器构建参数</span><br><span class="line">      context: ./</span><br><span class="line">      dockerfile: ./docker/app_local.dockerfile #dockerfile 的目录在当前项目下的docker文件下</span><br><span class="line">    working_dir: /app # 指定容器工作目录</span><br><span class="line">    restart: always</span><br><span class="line">    volumes: #目录挂载 修改php配置</span><br><span class="line">      - ./:/app</span><br><span class="line">      - ./docker/php.ini:/usr/local/etc/php/conf.d/php.ini #配置文件</span><br><span class="line">    environment: #这里可以添加修改.env的参数使其使用容器服务 </span><br><span class="line">      - REDIS_HOST=redis</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">  #</span><span class="hljs-bash"> nginx</span></span><br><span class="line">  web:</span><br><span class="line">    image: xxxx_web</span><br><span class="line">    build:</span><br><span class="line">      context: ./</span><br><span class="line">      dockerfile: ./docker/web.dockerfile</span><br><span class="line">    restart: always</span><br><span class="line">    depends_on:</span><br><span class="line">      - app</span><br><span class="line">    ports:</span><br><span class="line">      - 80:80  #前面的80指本地端口 后面的80指容器中的端口</span><br><span class="line">    volumes: #本机也需要记录日志</span><br><span class="line">      - ./:/app</span><br><span class="line">      - E:/DockerData/nginx/:/data/logs/nginx/</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">  #</span><span class="hljs-bash"> redis database 需要连接本地数据库时可以使用</span></span><br><span class="line">  redis:</span><br><span class="line">    container_name: xxx_redis #不使用dockfile的时候设置容器名称</span><br><span class="line">    volumes:</span><br><span class="line">      - E:/DockerData/redis:/data  # 挂载redis数据目录</span><br><span class="line">      - E:/DockerData/conf/redis/redis.conf:/etc/redis/redis.conf  # 需要配置文件 不然无法启动</span><br><span class="line">    image: redis</span><br><span class="line">    command: redis-server /etc/redis/redis.conf</span><br><span class="line">    ports:</span><br><span class="line">      - 6380:6379</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> mysql database 需要连接本地数据库时可以使用 </span></span><br><span class="line">  database:</span><br><span class="line">    container_name: xxx_mysql</span><br><span class="line">    image: mysql:5.7</span><br><span class="line">    command: --default-authentication-plugin=mysql_native_password</span><br><span class="line">    ports:</span><br><span class="line">    - 3316:3306</span><br><span class="line">    environment: #MYSQL_ROOT_PASSWORD 才是登陆密码 env中的密码</span><br><span class="line">    - "MYSQL_ROOT_PASSWORD=password"</span><br><span class="line">    - "MYSQL_DATABASE=database_name"</span><br><span class="line">    volumes: #需要数据转移的时候 可以挂载 没有的话就直接进入php容器 执行数据迁移</span><br><span class="line">    - D:/xxxx/MySQL5.7.26/data/xxx:/var/lib/mysql/xxxx</span><br><span class="line">  </span><br><span class="line"><span class="hljs-meta">  #</span><span class="hljs-bash">  laravel-echo-server</span></span><br><span class="line">  laravel-echo-server:</span><br><span class="line">    build:</span><br><span class="line">      context: ./</span><br><span class="line">      dockerfile: ./docker/laravel-echo-server.dockerfile</span><br><span class="line">    volumes:</span><br><span class="line">      - ./laravel-echo-server.json:/usr/src/app/laravel-echo-server.json</span><br><span class="line">    ports:</span><br><span class="line">      - 6001:6001 #关键 别设置错</span><br><span class="line">    links:</span><br><span class="line">      - redis #通知关联redis服务</span><br></pre></td></tr></table></figure>
</li>
<li><p>下面我们来看dockfile和配置文件</p>
</li>
</ul>
<ol>
<li>app_local.dockerfile (workspace 也就是php-fpm)</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">FROM php:7.3-fpm-alpine</span><br><span class="line">RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.huaweicloud.com/g' /etc/apk/repositories</span><br><span class="line">RUN apk update \</span><br><span class="line">    &amp;&amp; apk upgrade \</span><br><span class="line">    &amp;&amp; apk add --no-cache \</span><br><span class="line">        freetype \</span><br><span class="line">        libpng \</span><br><span class="line">        libjpeg-turbo \</span><br><span class="line">        freetype-dev \</span><br><span class="line">        libpng-dev \</span><br><span class="line">        jpeg-dev \</span><br><span class="line">        libjpeg \</span><br><span class="line">        libjpeg-turbo-dev \</span><br><span class="line">        libwebp-dev\</span><br><span class="line">        libzip-dev\</span><br><span class="line">        git</span><br><span class="line">RUN docker-php-ext-configure gd \</span><br><span class="line">                --with-freetype-dir=/usr/lib/ \</span><br><span class="line">                --with-png-dir=/usr/lib/ \</span><br><span class="line">                --with-jpeg-dir=/usr/lib/ \</span><br><span class="line">                --with-webp-dir=/usr/lib/</span><br><span class="line">RUN docker-php-ext-install mysqli pdo pdo_mysql gd zip</span><br><span class="line">WORKDIR /app</span><br><span class="line">RUN apk add composer npm</span><br><span class="line">RUN composer config -g repos.packagist composer https://packagist.phpcomposer.com</span><br><span class="line">RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> composer 和 npm的命令等容器创建好之后 进入容器进行 </span></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> composer install composer <span class="hljs-built_in">autoload</span>-dump 和 npm install npm run prod 等操作</span></span><br></pre></td></tr></table></figure>
<ol start="2">
<li>laravel-echo-server.dockfile(关于laravel-echo-server 使用和安装中的坑 可以看我之前的文章<a href="https://learnku.com/articles/48310" title="laravel-echo-server 踩坑记录" target="_blank" rel="noopener">laravel-echo-server 踩坑记录</a>)</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">FROM node:alpine</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> Create app directory</span></span><br><span class="line">RUN mkdir -p /usr/src/app</span><br><span class="line">WORKDIR /usr/src/app</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> 拷贝 属于 <span class="hljs-built_in">echo</span>-server自己的package.json 与项目本身的区分开</span></span><br><span class="line">COPY ./docker/package.json /usr/src/app/</span><br><span class="line"></span><br><span class="line">RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories</span><br><span class="line"></span><br><span class="line">RUN apk add --update \</span><br><span class="line">    python \</span><br><span class="line">    python-dev \</span><br><span class="line">    py-pip \</span><br><span class="line">    build-base</span><br><span class="line"></span><br><span class="line">RUN npm install</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> 根据项目自身的配置laravel-echo-server.json进行启动</span></span><br><span class="line">COPY laravel-echo-server.json /usr/src/app/laravel-echo-server.json</span><br><span class="line"></span><br><span class="line">EXPOSE 3000</span><br><span class="line">CMD [ "npm", "start", "--force" ] #容器构建后 启动echo-server</span><br></pre></td></tr></table></figure>
<ol start="3">
<li>package.json （laravel-echo-server 使用的）</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  "name": "laravel-echo-server-docker",</span><br><span class="line">  "description": "Docker container for running laravel-echo-server",</span><br><span class="line">  "version": "0.0.1",</span><br><span class="line">  "license": "MIT",</span><br><span class="line">  "dependencies": &#123;</span><br><span class="line">    "laravel-echo-server": "^1.5.0"</span><br><span class="line">  &#125;,</span><br><span class="line">  "scripts": &#123;</span><br><span class="line">    "start": "laravel-echo-server start"</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<ol start="4">
<li>php.ini(在yml文件中挂载了)</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">post_max_size = 500M</span><br><span class="line">upload_max_filesize = 500M</span><br><span class="line">memory_limit = 512M</span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash">...其他配置的更改</span></span><br></pre></td></tr></table></figure>
<ol start="5">
<li>vhost.conf（nginx 配置 更具体的内容可以看看laradock项目）</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">client_max_body_size 500m;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">proxy_read_timeout 240s;</span><br><span class="line"></span><br><span class="line">server &#123;</span><br><span class="line">    listen 80;</span><br><span class="line"></span><br><span class="line">    index index.php index.html;</span><br><span class="line">    root /app/public;</span><br><span class="line"></span><br><span class="line">    server_name xxxx.com;</span><br><span class="line"></span><br><span class="line">    access_log /data/logs/nginx/xxxx_access.log;</span><br><span class="line">    error_log /data/logs/nginx/xxxx_error.log;</span><br><span class="line"></span><br><span class="line">    location / &#123;</span><br><span class="line">        try_files $uri /index.php?$args;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    location ~ \.php$ &#123;</span><br><span class="line">        fastcgi_split_path_info ^(.+\.php)(/.+)$;</span><br><span class="line">        fastcgi_pass app:9000; #workspace的服务名称app</span><br><span class="line">        fastcgi_index index.php;</span><br><span class="line">        include fastcgi_params;</span><br><span class="line">        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;</span><br><span class="line">        fastcgi_param PATH_INFO $fastcgi_path_info;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<ol start="6">
<li>web.dockerfile （nginx的镜像文件）</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">FROM nginx:1.17-alpine</span><br><span class="line">ADD docker/vhost.conf /etc/nginx/conf.d/default.conf</span><br><span class="line">RUN mkdir -p /data/logs/nginx/</span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash">这里修改日志名称 与上面的文件相对应</span></span><br><span class="line">RUN touch /data/logs/nginx/xxxx_access.log</span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash">这里修改与上面的文件相对应</span></span><br><span class="line">RUN touch /data/logs/nginx/xxx_error.log</span><br></pre></td></tr></table></figure>
<h2 id="laravel-echo-server的部署指南"><a href="#laravel-echo-server的部署指南" class="headerlink" title="laravel-echo-server的部署指南"></a><a href="#d3">laravel-echo-server的部署指南</a></h2><ol start="7">
<li><p><strong>laravel-echo-server.json（authhost不修改的话会显示 Error authenticating）</strong></p>
<figure class="highlight hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">	<span class="hljs-attr">"authHost"</span>: <span class="hljs-string">"http://web"</span>,</span><br><span class="line">	<span class="hljs-attr">"authEndpoint"</span>: <span class="hljs-string">"/broadcasting/auth"</span>,</span><br><span class="line">	<span class="hljs-attr">"clients"</span>: [],</span><br><span class="line">	<span class="hljs-attr">"database"</span>: <span class="hljs-string">"redis"</span>,</span><br><span class="line">	<span class="hljs-attr">"databaseConfig"</span>: &#123;</span><br><span class="line">		"redis": &#123; //这里要修改的</span><br><span class="line">			"port": "6379",</span><br><span class="line">			"host": "redis"</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;,</span><br><span class="line">	"devMode": true,</span><br><span class="line">	"host": null,</span><br><span class="line">	"port": "6001",</span><br><span class="line">	"protocol": "http",</span><br><span class="line">	"socketio": &#123;&#125;,</span><br><span class="line">	"sslCertPath": "",</span><br><span class="line">	"sslKeyPath": ""</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>最后提示一下.env文件别忘了修改 QUEUE_CONNECTION、BROADCAST_DRIVER为redis，DB_HOST修改为服务名称，我这里叫database。以及涉及到的主机挂载目录是否都已经创建？</p>
</li>
</ol>
<hr>
<p>然后你就可以愉快的 docker-compose up -d ,docker-compose build 了</p>
<h4 id="supervisor-监控队列"><a href="#supervisor-监控队列" class="headerlink" title="supervisor 监控队列"></a><a href="#d4">supervisor 监控队列</a></h4><p><strong>先呈上supervisor.conf</strong></p>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">[program:yourname_queue]#这里改个自己名字</span><br><span class="line">process_name=%(program_name)s_%(process_num)02d</span><br><span class="line">directory=/app #你的容器内的项目目录 </span><br><span class="line">command=php artisan queue:work --tries=3 --sleep=3 --daemon</span><br><span class="line">autostart=true </span><br><span class="line">autorestart=true</span><br><span class="line">numprocs=1</span><br><span class="line">user=root</span><br><span class="line">stopasgroup=true</span><br><span class="line">killasgroup=true</span><br><span class="line">redirect_stderr=true</span><br><span class="line">stderr_logfile=/app/storage/logs/err_queue.log #配置错误日志文件路径</span><br><span class="line">stdout_logfile=/app/storage/logs/queue.log  #配置输出日志文件路径</span><br><span class="line">[supervisord]</span><br><span class="line"></span><br><span class="line">[supervisorctl]</span><br></pre></td></tr></table></figure>
<ol>
<li>在你的workspace容器内安装supervisor（直接配置dockfile即可）, 然后copy配置文件到容器内</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> 我这里是app_local.dockerfile</span></span><br><span class="line">RUN apk add supervisor</span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> supervisor 服务配置文件</span></span><br><span class="line">COPY ./docker/supervisor.conf /etc/supervisor/conf.d/supervisord.conf</span><br></pre></td></tr></table></figure>
<ol start="2">
<li>在镜像完成成为容器后执行启动命令</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec your_container_name /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf</span><br></pre></td></tr></table></figure>
<h4 id="容器内的定时任务"><a href="#容器内的定时任务" class="headerlink" title="容器内的定时任务"></a><a href="#d5">容器内的定时任务</a></h4><p><strong>呈上crontabs文件</strong></p>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash">最好不要用windows记事本编辑这个文件出现换行，以免出现不必要的bug</span></span><br><span class="line">* * * * * php /app/artisan schedule:run &gt;&gt; /app/storage/logs/crond.log 2&gt;&amp;1</span><br></pre></td></tr></table></figure>
<blockquote>
<p>因为我的workspace镜像使用的是alpine系统，不是centos和ubuntu之类的，所以它自带的crontab与其他的不同，这里我就列出alpine的步骤，其他系统的方式应该是先安装 然后需要修改crontab文件的权限为600 然后执行。</p>
</blockquote>
<p>1.在dockerfile中copy我们自己的crontab文件(可选)，也可以直接在命令行中echo方式书写一个crontab文件</p>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> 可选</span></span><br><span class="line">COPY ./docker/crontabs /etc/cron.d/</span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> 添加定时任务在docker中，似乎只能运行root的crontab命令，其路径在/var/spool/cron/crontabs/root中，并不是扫描cron.d/文件夹下面的所有文件，将自己的crontab脚本先copy到docker，再cat到docker的root脚本后面才可以运行</span></span><br><span class="line">RUN cat /etc/cron.d/crontabs&gt;&gt;/var/spool/cron/crontabs/root</span><br><span class="line"></span><br><span class="line"><span class="hljs-meta">#</span><span class="hljs-bash"> 如果是不copy文件 直接书写crontab的方式（可选）</span></span><br><span class="line">RUN echo -e '* * * * * php /app/artisan schedule:run &gt;&gt; /app/storage/logs/crond.log 2&gt;&amp;1'&gt;&gt;/var/spool/cron/crontabs/root</span><br></pre></td></tr></table></figure>
<ol start="2">
<li>在镜像完成成为容器后执行启动命令（类似supervisor），如果不这样做的话 直接在dockerfile中CMD或者Entrypoint的话，我尝试过会报错。</li>
</ol>
<figure class="highlight shell hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec your_container_name crond</span><br></pre></td></tr></table></figure>
<blockquote>
<p>这里我参考的文章链接<a href="https://blog.csdn.net/bigheadsnake/article/details/78392539" title="在alpine linux构建的docker中使用crontab执行定时任务" target="_blank" rel="noopener">在alpine linux构建的docker中使用crontab执行定时任务</a><br>里面也包含了修改容器 date 时区的方式 我就不赘述了。</p>
</blockquote>
<p><strong>再重申一遍 我这是alpine的镜像 其他linux的镜像方式可百度</strong></p>
<hr>
<p>好啦 结束了。以后若有新的dockerfile新增，我也会更新的。</p>

        </div>
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/docker/">docker</a>, <a class="has-link-grey -link" href="/tags/laravel-echo-server/">laravel-echo-server</a>, <a class="has-link-grey -link" href="/tags/supervisor/">supervisor</a>
                </div>
            </div>
        </div>
        
        
        
        <div class="social-share"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">喜欢这篇文章？打赏一下作者吧</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>支付宝</span>
    <div class="qrcode"><img src="https://i.loli.net/2020/09/04/bwDxBLPhmSCMQHY.jpg" alt="支付宝"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>微信</span>
    <div class="qrcode"><img src="https://i.loli.net/2020/09/04/aXMbI9SeGY7DVtu.jpg" alt="微信"></div>
</a>

                
        </div>
    </div>
</div>



<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        <div class="level-start">
            <a class="level level-item has-link-grey  article-nav-prev" href="/2021/09/03/golang小技巧 && 小坑坑(持续更新)/">
                <i class="level-item fas fa-chevron-left"></i>
                <span class="level-item">golang 小技巧 &amp;&amp; 小坑坑 （持续更新ing）</span>
            </a>
        </div>
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/2020/09/15/laravel-echo-server-踩坑记录/">
                <span class="level-item">laravel-echo-server 踩坑记录</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="title is-5 has-text-weight-normal">评论</h3>
        
<div id="SOHUCS" sid="2020/09/15/windows-使用docker-compose-DockFile部署项目-内含laravel-echo-server/"></div>
<script charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/changyan.js"></script>
<script type="text/javascript">
window.changyan.api.config({
    appid: 'xxxxxxxx',
    conf: 'prod_xxxxxxxx'
});
</script>

    </div>
</div>
</div>
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-1 column-left ">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered">
                <div>
                    
                        <figure class="image container is-128x128 has-mb-6">
                            <img class="is-rounded" src="https://cdn.learnku.com/uploads/avatars/25478_1552028471.jpg!/both/300x300" alt="Enzo">
                        </figure>
                    
                    
                    <p class="is-size-4 is-block">
                        Enzo
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        Let it be
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>天津</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        文章
                    </p>
                    <p class="title has-text-weight-normal">
                        24
                    </p>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        分类
                    </p>
                    <p class="title has-text-weight-normal">
                        3
                    </p>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        标签
                    </p>
                    <p class="title has-text-weight-normal">
                        16
                    </p>
                </div>
            </div>
        </nav>
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://weibo.com/u/2812380431">
                关注我</a>
        </div>
        
        
    </div>
</div>
    
        
    
        

<div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            链接
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://github.com/EnzoLwb" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Github</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">github.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://gitee.com/enzolwb" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Gitee</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">gitee.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://learnku.com/blog/liwenbo" target="_blank">
                    <span class="level-left">
                        <span class="level-item">Learnku</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">learnku.com</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>


    
        
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                分类
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/前端/">
            <span class="level-start">
                <span class="level-item">前端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/后端/">
            <span class="level-start">
                <span class="level-item">后端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">16</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/服务端/">
            <span class="level-start">
                <span class="level-item">服务端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
    
        
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            标签云
        </h3>
        <a href="/tags/FFMPEG/" style="font-size: 10px;">FFMPEG</a> <a href="/tags/Git/" style="font-size: 10px;">Git</a> <a href="/tags/Laravel/" style="font-size: 16.67px;">Laravel</a> <a href="/tags/Vue/" style="font-size: 10px;">Vue</a> <a href="/tags/docker/" style="font-size: 10px;">docker</a> <a href="/tags/elasticsearch/" style="font-size: 10px;">elasticsearch</a> <a href="/tags/flarum/" style="font-size: 10px;">flarum</a> <a href="/tags/golang/" style="font-size: 20px;">golang</a> <a href="/tags/laravel-echo-server/" style="font-size: 13.33px;">laravel-echo-server</a> <a href="/tags/lnmp/" style="font-size: 13.33px;">lnmp</a> <a href="/tags/nginx/" style="font-size: 10px;">nginx</a> <a href="/tags/redis/" style="font-size: 13.33px;">redis</a> <a href="/tags/supervisor/" style="font-size: 10px;">supervisor</a> <a href="/tags/支付/" style="font-size: 10px;">支付</a> <a href="/tags/爬虫/" style="font-size: 10px;">爬虫</a> <a href="/tags/论坛/" style="font-size: 10px;">论坛</a>
    </div>
</div>

    
    
        <div class="column-right-shadow is-hidden-widescreen ">
        
            
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            最新文章
        </h3>
        
        <article class="media">
            
            <a href="/2022/01/24/Go和Redis的规范/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/thumbnails/jscw1.png" alt="Go + Redis 的规范">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2022-01-24T12:05:10.000Z">2022-01-24</time></div>
                    <a href="/2022/01/24/Go和Redis的规范/" class="has-link-black-ter is-size-6">Go + Redis 的规范</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/后端/">后端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2022/01/08/Redis性能影响因素/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="Redis性能影响因素">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2022-01-08T06:10:21.000Z">2022-01-08</time></div>
                    <a href="/2022/01/08/Redis性能影响因素/" class="has-link-black-ter is-size-6">Redis性能影响因素</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/服务端/">服务端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2021/12/08/规范开发设计/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="规范开发设计">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2021-12-08T06:19:18.000Z">2021-12-08</time></div>
                    <a href="/2021/12/08/规范开发设计/" class="has-link-black-ter is-size-6">规范开发设计</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/服务端/">服务端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2021/11/14/zap库的源码解读/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/thumbnails/code.png" alt="zap库的源码解读">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2021-11-14T02:15:00.000Z">2021-11-14</time></div>
                    <a href="/2021/11/14/zap库的源码解读/" class="has-link-black-ter is-size-6">zap库的源码解读</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/后端/">后端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2021/09/14/逃逸分析/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/thumbnails/max1.png" alt="go 逃逸分析">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2021-09-14T12:15:00.000Z">2021-09-14</time></div>
                    <a href="/2021/09/14/逃逸分析/" class="has-link-black-ter is-size-6">go 逃逸分析</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/后端/">后端</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>

        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2022/01/">
                <span class="level-start">
                    <span class="level-item">一月 2022</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2021/12/">
                <span class="level-start">
                    <span class="level-item">十二月 2021</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2021/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2021</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2021/09/">
                <span class="level-start">
                    <span class="level-item">九月 2021</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/09/">
                <span class="level-start">
                    <span class="level-item">九月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">三月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/02/">
                <span class="level-start">
                    <span class="level-item">二月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/FFMPEG/">
                        <span class="tag">FFMPEG</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Git/">
                        <span class="tag">Git</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Laravel/">
                        <span class="tag">Laravel</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Vue/">
                        <span class="tag">Vue</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/docker/">
                        <span class="tag">docker</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/elasticsearch/">
                        <span class="tag">elasticsearch</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/flarum/">
                        <span class="tag">flarum</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/golang/">
                        <span class="tag">golang</span>
                        <span class="tag is-grey">10</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/laravel-echo-server/">
                        <span class="tag">laravel-echo-server</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/lnmp/">
                        <span class="tag">lnmp</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/nginx/">
                        <span class="tag">nginx</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/redis/">
                        <span class="tag">redis</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/supervisor/">
                        <span class="tag">supervisor</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/支付/">
                        <span class="tag">支付</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/爬虫/">
                        <span class="tag">爬虫</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/论坛/">
                        <span class="tag">论坛</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                




<div class="column is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only has-order-3 column-right ">
    
        
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            最新文章
        </h3>
        
        <article class="media">
            
            <a href="/2022/01/24/Go和Redis的规范/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/thumbnails/jscw1.png" alt="Go + Redis 的规范">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2022-01-24T12:05:10.000Z">2022-01-24</time></div>
                    <a href="/2022/01/24/Go和Redis的规范/" class="has-link-black-ter is-size-6">Go + Redis 的规范</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/后端/">后端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2022/01/08/Redis性能影响因素/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="Redis性能影响因素">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2022-01-08T06:10:21.000Z">2022-01-08</time></div>
                    <a href="/2022/01/08/Redis性能影响因素/" class="has-link-black-ter is-size-6">Redis性能影响因素</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/服务端/">服务端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2021/12/08/规范开发设计/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="规范开发设计">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2021-12-08T06:19:18.000Z">2021-12-08</time></div>
                    <a href="/2021/12/08/规范开发设计/" class="has-link-black-ter is-size-6">规范开发设计</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/服务端/">服务端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2021/11/14/zap库的源码解读/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/thumbnails/code.png" alt="zap库的源码解读">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2021-11-14T02:15:00.000Z">2021-11-14</time></div>
                    <a href="/2021/11/14/zap库的源码解读/" class="has-link-black-ter is-size-6">zap库的源码解读</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/后端/">后端</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2021/09/14/逃逸分析/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/thumbnails/max1.png" alt="go 逃逸分析">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2021-09-14T12:15:00.000Z">2021-09-14</time></div>
                    <a href="/2021/09/14/逃逸分析/" class="has-link-black-ter is-size-6">go 逃逸分析</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/后端/">后端</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>

    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2022/01/">
                <span class="level-start">
                    <span class="level-item">一月 2022</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2021/12/">
                <span class="level-start">
                    <span class="level-item">十二月 2021</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2021/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2021</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2021/09/">
                <span class="level-start">
                    <span class="level-item">九月 2021</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/09/">
                <span class="level-start">
                    <span class="level-item">九月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">三月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/02/">
                <span class="level-start">
                    <span class="level-item">二月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/FFMPEG/">
                        <span class="tag">FFMPEG</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Git/">
                        <span class="tag">Git</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Laravel/">
                        <span class="tag">Laravel</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Vue/">
                        <span class="tag">Vue</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/docker/">
                        <span class="tag">docker</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/elasticsearch/">
                        <span class="tag">elasticsearch</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/flarum/">
                        <span class="tag">flarum</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/golang/">
                        <span class="tag">golang</span>
                        <span class="tag is-grey">10</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/laravel-echo-server/">
                        <span class="tag">laravel-echo-server</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/lnmp/">
                        <span class="tag">lnmp</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/nginx/">
                        <span class="tag">nginx</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/redis/">
                        <span class="tag">redis</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/supervisor/">
                        <span class="tag">supervisor</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/支付/">
                        <span class="tag">支付</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/爬虫/">
                        <span class="tag">爬虫</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/论坛/">
                        <span class="tag">论坛</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
    
    
</div>

            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    LiWb Blog
                
                </a>
                <p class="is-size-7">
                &copy; 2022 Li Wen Bo&nbsp;
                Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> & <a href="http://github.com/ppoffice/hexo-theme-icarus" target="_blank">Icarus</a>
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Repositories  on GitHub" href="https://github.com/EnzoLwb">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Repositories  on Gitee" href="https://gitee.com/enzolwb">
                        
                        <i class="fab fa-gofore"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("zh-CN");</script>


    
    
    
    <script src="/js/animation.js"></script>
    

    
    
    
    <script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
    <script src="/js/gallery.js" defer></script>
    

    
    

<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


    
    
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>

    
    

<a id="back-to-top" title="回到顶端" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>


    
    

    
    
    
    

    
    
    
    
    
    <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>
    <script src="/js/clipboard.js" defer></script>
    

    
    
    


<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="想要查找什么...">
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: '文章',
                PAGES: '页面',
                CATEGORIES: '分类',
                TAGS: '标签',
                UNTITLED: '(无标题)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
</body>
</html>